﻿using System.Collections.Generic;
using UnityEngine;

namespace Sliver.Roadnet.RawInfo
{
    public struct RawLaneJsonData
    {
        public string id;
        public float width;
        public float maxSpeed;
    }

    public struct RawLanelinkInfo
    {
        public int startLaneIndex;
        public int endLaneIndex;
        public List<Vector2> points;
    }

    public struct RawRoadLinkInfo
    {
        public string type;
        public string startRoad;
        public string endRoad;
        public int direction;
        public List<RawLanelinkInfo> laneLinks;
    }

    public struct LightPhase
    {
        public float time;
        public List<int> availableRoadLinks;
    }

    public class RawTrafficLightInfo
    {
        public List<int> roadLinkIndices;
        public List<LightPhase> lightphases;
    }

    public class IntersectionJsonData
    {
        public string id;
        public Vector2 point;
        public float width;
        public List<string> roads;
        public List<RawRoadLinkInfo> roadLinks;
        public RawTrafficLightInfo trafficLight;
        public bool @virtual;
    }

    public class RawRoadInfo
    {
        public string id;
        public List<Vector2> points;
        public List<RawLaneJsonData> lanes;
        public string startIntersection;
        public string endIntersection;
    }

    public class RawRoadNetInfo
    {
        public List<IntersectionJsonData> intersections;
        public List<RawRoadInfo> roads;
    }
}
